package com.demo.java.reference;

import java.lang.ref.SoftReference;

// -Xmx10m -Xms10m
public class SoftReferenceTest {

    public static void main(String[] args) throws InterruptedException {
        int mb = 1024 * 1024;
        SoftReference<byte[]> softReference = new SoftReference<>(new byte[mb * 5]);

        System.gc();
        Thread.sleep(100);

        byte[] bytes = new byte[mb * 6];
    }
}
